import Vue from 'vue'

export default {
  
  getList (map = {}) {
    //map['all']=true;
    return new Promise((resolve, reject) => {
      Vue.axios.get('/roleAuth', { params: map }).then(response => {
        resolve(response.data)
      })
    })
  },
  
  //getInfo (slug) {
  //  return new Promise((resolve, reject) => {
  //    Vue.axios.get('/userTag/' + slug).then(response => {
  //      resolve(response.data)
  //    })
  //  })
  //},
  
  update (id, data) {
    return new Promise((resolve, reject) => {
      Vue.axios.put('/roleAuth/' + id, data).then(response => {
        resolve(response.data)
      })
    })
  },
  
  addRuler(data) {
    return new Promise((resolve, reject) => {
      Vue.axios.post('/roleAuth', data).then(response => {
        resolve(response.data)
      })
    })
  },
  
  delete (id) {
    return new Promise((resolve, reject) => {
      Vue.axios.delete('/roleAuth/' + id).then(response => {
        resolve(response.data)
      })
    })
  }
}
